#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "UI/MainUI/InterFaceUIMain.h"
#include <QPushButton>
#include "UI/ModRun/InterfaceModRunCreate.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow,public IUIElement
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    // 通过 IUIElement 继承
    void accept(IVisitor& visitor) override;

    //获取UI;
    Ui::MainWindow* GetUI();

    //文字过长显示省略号;
    QString GetElideString(const QFont& font, const QString content, const int width);


public slots:
    //tab页签改变通知;
    void tabMain_currentChanged(int index);

    //清空日志;
    void ClearLog(bool checked = false);

    //点击运行按钮;
    void OnModelRun(bool checked = false);

    //点击了按钮;
    void OnClicked(bool checked = false);

private:

    //初始化按钮绑定;
    void InitClickBind();

    //绑定一个按钮到ModRun;
    void ClickBindOne(QPushButton* pBtn, EnumModRun emModRun);

private:
    Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
